package com.attilax.push;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.impl.StaticLoggerBinder;

import cn.jpush.api.common.APIConnectionException;
import cn.jpush.api.common.APIRequestException;
import cn.jpush.api.common.NativeHttpClient;

import com.attilax.core;


/**
 * com.attilax.push.PushTest
 * @author Administrator
 *
 */
public class PushTest {
	static final Logger LOG = LoggerFactory.getLogger(NativeHttpClient.class);
	public static	ExecutorService fixedThreadPool = Executors.newFixedThreadPool(300);
	public static void main(String[] args) throws APIConnectionException, APIRequestException {
		
	//	StaticLoggerBinder
	//	LOG.info("ttt");
//System.out.println("ff");
	 	t();
	//	for_single(1);
	// jsonob
		System.out.println("aaa");

	}



	private static void t() {
		int j = 100000 * 11000000;
		for (double i = 5; i >0; ) {
			try {
				for_single(i);
			//	System.out.println(i);
				Thread.sleep(5);
			//	i++
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	

	private static void for_single(final double i)
			throws APIConnectionException, APIRequestException {

		Runnable runnable = new Runnable() {
			public void run() {
				try {
					single_test_step2(i);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}

		};
		fixedThreadPool.execute(runnable);

	}
	
	
	private static void single_test_step2(double i) {
		String r = "";
		try {
			r = new pushX().push(".", 1099);
		} catch (APIConnectionException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(String.valueOf(i) + "::" + r);

	}

}
